-- ********************************************
-- * Copyright (c) 2012 TPV R&D Center Brazil *
-- * All Rights Reserved                      *
-- ********************************************

--- toolkit.component.Circle

local Circle = Box:new()

function Circle:new(o)
   if(type(o) ~= 'table') then
      o = {}
   end

   local newCircle = Box:new(o)
   
   newCircle.parent = nil

   newCircle.componentType = "Circle"

   newCircle.radius = o.radius or 0

   newCircle.angle = o.angle or 360

   --generate an object
   setmetatable(newCircle, self)
   self.__index = self

   return newCircle
end

function Circle:setColor(o)
   if(type(o) ~= "table") then
      o = {0, 0, 0, 0}
   end

   self.color = o
end

function Circle:setAngle(o)
   if(type(o) ~= "number") then
      o = self.angle
   end

   self.angle = o
end

function Circle:redraw()
   self.parent:update(self)
end

return Circle
